package com.guigu.liuyunan.controller;

import com.github.pagehelper.PageInfo;
import com.guigu.liuyunan.pojo.LYNPageVo;
import com.guigu.liuyunan.pojo.Sportsitemlibrary;
import com.guigu.liuyunan.service.SportsItemLibraryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("LYN")
public class sportsItemLibraryController {

    @Autowired
    SportsItemLibraryService sb;


    @PostMapping("sportsItemLibraryInfo")
    public PageInfo<Sportsitemlibrary> sportsItemLibraryInfo(@RequestBody LYNPageVo pageVo){
        if (pageVo.getName()!=null){
            pageVo.setName(pageVo.getName().trim());
        }
        return sb.sportsItemLibraryInfo(pageVo);
    }

    @PostMapping("addSportsItemLibrary")
    public int AddSportsItemLibrary(@RequestBody Sportsitemlibrary sportsitemlibrary){
        return sb.AddSportsItemLibrary(sportsitemlibrary);
    }

    @PostMapping("upSportsItemLibrary")
    public int UpSportsItemLibrary(@RequestBody Sportsitemlibrary sportsitemlibrary){
        return sb.UpSportsItemLibrary(sportsitemlibrary);
    }

    @GetMapping("delSportsItemLibrary")
    public int delSportsItemLibrary(Integer id){
        return sb.delSportsItemLibrary(id);
    }

}
